package pingji.service.register.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pingji.controller.ResponseObject;
import pingji.controller.register.RegisterObject;
import pingji.dao.register.RegisterDao;
import pingji.service.register.RegisterService;
@Service
public class RegisterServiceImpl implements RegisterService {
    @Autowired
    RegisterDao dao;
    @Override
    public ResponseObject registerService(RegisterObject o) {
        if(dao.userIsExists(o.getUsername())){
            return new ResponseObject(1,"用户已经存在");
        }
        dao.addUser(o);
        return new ResponseObject(0,"注册成功");
    }
}
